See Chapter 2 if you don’t feel comfortable reading the mathematical notations or expressions

in this section.

Running a Straight-Line Regression

Even if it is possible, it is not a good idea to calculate regressions manually or with a

calculator. You’ll go crazy trying to evaluate all those summations and other calculations, and

you’ll almost certainly make a mistake somewhere in your calculations.

Fortunately, most statistical packages can perform a straight-line regression. Microsoft Excel has built-

in functions for calculating the slope and intercept of the least-squares straight line. You can also find

straight-line regression web pages (several are listed at https://statpages.info). If you use R,

you can explore using the lm() command. (See Chapter 4 for an introduction to statistical software.) In

the following sections, we list the basic steps for running a straight-line regression, complete with an

example.

Taking a few basic steps

The exact steps you take to run a straight-line regression depend on what software you’re

using, but here’s the general approach:

1. Structure your data into the proper form.

Usually, the data consist of two columns of numbers, one representing the independent variable and

the other representing the dependent variable.

2. Tell the software which variable is the independent variable and which one is the dependent

variable.

Depending on the software, you may type in the variable names, or pick them from a menu or list in

your file.

3. If the software offers output options, tell it that you want it to output these results:

Graphs of observed and calculated values

Summaries and graphs of the residuals

Regression table

Goodness-of-fit measures

4. Execute the regression in the software (tell it to run the regression).